//
//  WebAsk.m
//  douban
//
//  Created by dllo on 15/11/15.
//  Copyright (c) 2015年 liyinkai. All rights reserved.
//

#import "WebAsk.h"

@implementation WebAsk

+(void)chuan:(NSString *)url withBlock:(void (^)(id result))block {

    NSURL *url1 = [NSURL URLWithString:url];
    NSURLRequest *request = [NSURLRequest requestWithURL:url1];
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
        id result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
        block(result);
    }];

}

@end
